home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / AMOSList / AMOSLIST.0897 / 000057_amos-request@svcs1.digex.net_Tue Aug 5 22:37:44 1997.msg < prev    next >
Text File  |  1997-09-09  |  3KB  |  86 lines

  1. Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
  2.     by mail1.access.digex.net (8.8.5/8.8.5) with ESMTP id WAA05330
  3.     for <mcox@access.digex.net>; Tue, 5 Aug 1997 22:37:42 -0400 (EDT)
  4. Received: (from daemon@localhost)
  5.     by svcs1.digex.net (8.8.5/8.8.5) id UAA02611
  6.     for amos-out; Tue, 5 Aug 1997 20:20:53 -0400 (EDT)
  7. Received: from mail2.access.digex.net (mail2.access.digex.net [205.197.247.3])
  8.     by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id UAA02608
  9.     for <amos-list@svcs1.digex.net>; Tue, 5 Aug 1997 20:20:52 -0400 (EDT)
  10. Received: from mail.redrose.net (qmailr@mail.redrose.net [204.249.184.22])
  11.     by mail2.access.digex.net (8.8.5/8.8.5) with SMTP id UAA06736
  12.     for <amos-list@access.digex.net>; Tue, 5 Aug 1997 20:20:51 -0400 (EDT)
  13. Received: (qmail 18036 invoked from network); 5 Aug 1997 20:24:18 -0000
  14. Received: from herp1-33.redrose.net (HELO redrose.net) (mushy-pd@208.7.248.161)
  15.   by mail.redrose.net with SMTP; 5 Aug 1997 20:24:18 -0000
  16. From: Mush <mushypd@redrose.net>
  17. Reply-To: mushypd@redrose.net
  18. To: Dale Hymanyk <dhymanyk@telusplanet.net>
  19. CC: amos-list@access.digex.net
  20. Date: Tue, 05 Aug 1997 20:20:34 -0500
  21. Message-ID: <yam7156.1732.4563920@mail.redrose.net>
  22. In-Reply-To: <yam7155.952.121761680@mail.telusplanet.net>
  23. X-Mailer: YAM 1.3.3a [020] - Amiga Mailer by Marcel Beck
  24. Organization: Mushroom PD - AMOS Public Domain Library
  25. Subject: Re: File Problems
  26. MIME-Version: 1.0
  27. Content-Type: text/plain
  28. Status: O
  29. X-Status: 
  30.  
  31. Dale Hymanyk scrawled this garbage in a text editor on 04-Aug-97 regarding the
  32. subject of File Problems:
  33.  
  34. > Anyway I'm trying to open a text file, load it into a memory bank, alter it
  35. > using the ldos 'lreplace, command and save it with a new file name.
  36.  
  37. Ive looked at your code, and having never tried the LDos extension, the way
  38. you made some code to do a simple task looks rather long and not necessary.
  39.  
  40. To save a file with a new name:
  41.  
  42. a$= Original file and path
  43. b$= New Path and name
  44.  
  45. open in 1,a$:reserve as data 16,lof(1):close:bload a$,start(16)
  46. bsave b$,start(16) to start(16)+length(16):erase 16
  47.  
  48. To alter your lines and save with new name:
  49.  
  50. a$= Original text file
  51. b$= New text file
  52.  
  53. open in 1,a$:open out 2,b$
  54. set input 10,-1
  55.  
  56. line input #1,tex$
  57.  
  58. repeat
  59. lp1:
  60. i=instr(tex$," "):rem Look for a Space 
  61. if i>0
  62.    tex2$=mid$(tex$,1,i-1)+","+mid$(tex$,i+1,len(tex$)
  63.    rem Replace it with the ,
  64.    tex=tex2$:goto lp1
  65. endif
  66.  
  67. print #2,tex$
  68. line input #1,a$
  69. until eof(1)
  70.  
  71. close 1:close 2
  72.  
  73. This program will replace all occurences of the space, and replace them
  74. with a comma. This does it constantly till no more occurences can be found
  75. on the line, then goes to the next. The process is repeated till the end of
  76. the input file.
  77.  
  78. Andrew "Mushroom" Kellett
  79. --
  80.          Email: Andy Kellett <mushypd@redrose.net>   Team *AMIGA*
  81.  
  82.      World's Largest AMOS Homepages - http://www.mushy-pd.demon.co.uk
  83.  
  84.          Massive FTP site with AMOS/C64 and Mods/Samples + more at
  85.                             mushy-pd.dyn.ml.org
  86.